import Opt from '@/components/dt/info/Opt.js'

let _this = null

class Column extends Opt {
  constructor(vm) {
    super()
    _this = vm
    this.build()
  }

  build() {
    this.createAll()
    this.opts.push(...this.all)
  }

  createAll() {
    this.all = [
      {
        title: '公司范围',
        field: 'orgNames',
        minWidth: 200,
        align: 'center'
      },
      {
        title: '配置项',
        field: 'configContent',
        minWidth: 120,
        align: 'center',
        slots: {
          default: (params, h) => {
            return params.row.configContent ? params.row.configContent : `案场内客户到访跟进保护期`
          }
        }
      },
      {
        title: '状态',
        field: 'configStatus',
        width: 100,
        align: 'center',
        slots: {
          default: (params, h) => {
            return params.row.configStatus == '1' ? '打开' : '关闭'
          }
        }
      },
      {
        title: '配置内容',
        field: 'configDetails',
        minWidth: 180
        // align: 'center',
        // slots: {
        //   default: (params, h) => {
        //     return params.row.configStatus == '1' ? `到访后，连续${params.row.configDays}天不跟进，客户将进入案场公客池` : ''
        //   },
        // }
      },
      {
        title: '操作',
        fixed: 'right',
        width: 140,
        align: 'center',
        cell: () => {
          let btn = []
          btn.push({
            title: '编辑',
            event: 'edit',
            code: '0204100200'
          })
          btn.push({
            title: '删除',
            event: 'delete',
            code: '0204100300'
          })
          return {
            btn
          }
        }
      }
    ]
  }
}

export default Column
